unit UfrmProductBrowse;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, UfrmStandarBrowse, DBGridEhGrouping, RzPanel, GridsEh, DBGridEh,
  ExtCtrls, DB, ADODB, ActnList, RzButton,UfrmBaseEdit, UBaseBrowseForm,
  StdCtrls, RzCommon, RzRadChk;

type
  TfrmProductBrowse = class(TfrmStandarBrowse)
    qryProduct: TADOQuery;
    DBGridProduct: TDBGridEh;
    Label1: TLabel;
    Edit1: TEdit;
    RzCheckBox1: TRzCheckBox;
    RzBitBtn1: TRzBitBtn;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  protected
    function GetEditParams:Variant;override;
    function CreateEditForm:TfrmBaseEdit;override;
    procedure IniReportDataSet;override;
  public
    { Public declarations }
  end;

var
  frmProductBrowse: TfrmProductBrowse;

implementation

uses UdataMoudule,UfrmProductEdit;

{$R *.dfm}

 { TfrmProductBrowse }

function TfrmProductBrowse.CreateEditForm: TfrmBaseEdit;
begin
    Result:=TfrmProductEdit.Create(self);
end;

function TfrmProductBrowse.GetEditParams: Variant;
begin
   Result:= DataSet.FieldByName('productid').AsInteger;
end;

procedure TfrmProductBrowse.IniReportDataSet;
begin
  inherited;
  ReportDataSetList.Clear;
  ReportDataSetList.AddObject(qryProduct.Name,qryProduct);
end;

procedure TfrmProductBrowse.FormCreate(Sender: TObject);
begin
  inherited;
  qryProduct.Active:=true;
end;

initialization
    RegisterClass(TfrmProductBrowse);
 finalization
    UnRegisterClass(TfrmProductBrowse);   

end.
